package com.ruoyi.draw.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.draw.mapper.ModelConfigMapper;
import com.ruoyi.draw.domain.ModelConfig;
import com.ruoyi.draw.service.IModelConfigService;

/**
 * ModelConfigService业务层处理
 * 
 * @author Locke
 * @date 2025-10-25
 */
@Service
public class ModelConfigServiceImpl implements IModelConfigService 
{
    @Autowired
    private ModelConfigMapper modelConfigMapper;

    /**
     * 查询ModelConfig
     * 
     * @param id ModelConfig主键
     * @return ModelConfig
     */
    @Override
    public ModelConfig selectModelConfigById(Long id)
    {
        return modelConfigMapper.selectModelConfigById(id);
    }

    /**
     * 查询ModelConfig列表
     * 
     * @param modelConfig ModelConfig
     * @return ModelConfig
     */
    @Override
    public List<ModelConfig> selectModelConfigList(ModelConfig modelConfig)
    {
        return modelConfigMapper.selectModelConfigList(modelConfig);
    }

    /**
     * 新增ModelConfig
     * 
     * @param modelConfig ModelConfig
     * @return 结果
     */
    @Override
    public int insertModelConfig(ModelConfig modelConfig)
    {
        modelConfig.setId(System.currentTimeMillis());
        modelConfig.setCreateBy(SecurityUtils.getUsername());
        modelConfig.setCreateTime(DateUtils.getNowDate());
        return modelConfigMapper.insertModelConfig(modelConfig);
    }

    /**
     * 修改ModelConfig
     * 
     * @param modelConfig ModelConfig
     * @return 结果
     */
    @Override
    public int updateModelConfig(ModelConfig modelConfig)
    {
        modelConfig.setUpdateBy(SecurityUtils.getUsername());
        modelConfig.setUpdateTime(DateUtils.getNowDate());
        return modelConfigMapper.updateModelConfig(modelConfig);
    }

    /**
     * 批量删除ModelConfig
     * 
     * @param ids 需要删除的ModelConfig主键
     * @return 结果
     */
    @Override
    public int deleteModelConfigByIds(Long[] ids)
    {
        return modelConfigMapper.deleteModelConfigByIds(ids);
    }

    /**
     * 删除ModelConfig信息
     * 
     * @param id ModelConfig主键
     * @return 结果
     */
    @Override
    public int deleteModelConfigById(Long id)
    {
        return modelConfigMapper.deleteModelConfigById(id);
    }
}
